package com.white.service.imp;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.white.bean.Comment;
import com.white.mapper.CommentMapper;
import com.white.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements CommentService {
    @Autowired
    CommentMapper commentMapper;
    @Override
    public List<Comment> getCommentByArticleId(Long articleId) {
        return commentMapper.getCommentByArticleId(articleId);
    }

    @Override
    public List<Comment> getReplies(Long commentId) {
        return commentMapper.getReplies(commentId);
    }

    @Override
    public Comment getOne(Comment comment) {
        return commentMapper.getOne(comment);
    }

    @Override
    public List<Comment> getCommentByUserId(Long userId) {
        return commentMapper.getCommentByUserId(userId);
    }
}
